package jdk8;

/**
 * 2个接口都有default的时候,会编译错误,Class要自己覆盖方法,然后interface.super.fun()
 */
public class DefaultTest2 {
    public static void main(String[] args) {
        DefaultTest2_I i1 = new DefaultTest2_C();
        DefaultTest2_C c1 = new DefaultTest2_C();
        i1.fun();
        c1.fun();

    }
}

interface DefaultTest2_I {
    default void fun() {
        System.out.println("interface fun1");
    }
}


class DefaultTest2_C implements DefaultTest2_I {
    public void fun() {
        System.out.println("class fun1");
    }
}
